﻿using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace XieCan.AspMVC.Models
{
    /// <summary>
    /// 账号信息类
    /// </summary>
    [Table("Account")]
    [XieCanT6Reflect(Summary = "账号信息", Name ="Account")]
    public class AccountModel : BaseModel
    {
        /// <summary>
        /// 账号
        /// </summary>
        [Column(TypeName = "varchar")]
        public string Account { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        [Column(TypeName = "varchar")]
        public string Password { get; set; }

        /// <summary>
        /// 加盐加密
        /// </summary>
        [Column(TypeName = "varchar")]
        public string Salt { get; set; }

        /// <summary>
        /// 注册时间
        /// </summary>
        public override DateTime CreateTime { get => base.CreateTime; set => base.CreateTime = value; }

        /// <summary>
        /// 最后一次登录时间
        /// </summary>
        public DateTime? LastTime { get; set; }

        /// <summary>
        /// 登录错误次数
        /// </summary>
        public int ErrorTimes { get; set; }

        /// <summary>
        /// 基本信息
        /// </summary>
        [ForeignKey("Id")]
        public virtual UserInfoModel UserInfo { get; set; }
    }
}
